package com.szpx.service.impl;

import com.szpx.service.XueyuanService;
import com.szpx.mapper.XueyuanMapper;
import com.szpx.entity.ZRZ.Xueyuan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class XueyuanServiceImpl implements XueyuanService {

    @Autowired
    private XueyuanMapper xueyuanMapper;

    @Override
    public Xueyuan getById(Integer id) {
        return xueyuanMapper.selectById(id);
    }

    @Override
    public List<Xueyuan> getAll() {
        return xueyuanMapper.selectAll();
    }

    @Override
    public boolean save(Xueyuan xueyuan) {
        return xueyuanMapper.insert(xueyuan) > 0;
    }

    @Override
    public boolean update(Xueyuan xueyuan) {
        return xueyuanMapper.update(xueyuan) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return xueyuanMapper.deleteById(id) > 0;
    }

    @Override
    public Xueyuan getByIdCard(String idCard) {
        return xueyuanMapper.selectByIdCard(idCard);
    }
}